package com.runvp.service.biz.service.impl;

import java.util.List;

import com.runvp.common.utils.DateUtils;
import com.runvp.service.biz.handler.WechatPayHandler;
import com.runvp.service.biz.service.IBizCustomerTranLogService;
import com.runvp.service.biz.service.IBizCustomerWalletService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.runvp.service.biz.mapper.BizCustomerRechargeMapper;
import com.runvp.service.biz.domain.BizCustomerRecharge;
import com.runvp.service.biz.service.IBizCustomerRechargeService;
import com.runvp.common.core.text.Convert;

/**
 * 用户充值Service业务层处理
 * 
 * @author runvp
 * @date 2022-11-15
 */
@Service
public class BizCustomerRechargeServiceImpl implements IBizCustomerRechargeService {
    @Autowired
    private BizCustomerRechargeMapper bizCustomerRechargeMapper;
    @Autowired
    private WechatPayHandler wechatPayHandler;
    @Autowired
    private IBizCustomerWalletService bizCustomerWalletService;
    @Autowired
    private IBizCustomerTranLogService bizCustomerTranLogService;
    /**
     * 查询用户充值
     * 
     * @param id 用户充值主键
     * @return 用户充值
     */
    @Override
    public BizCustomerRecharge selectBizCustomerRechargeById(Long id) {
        return bizCustomerRechargeMapper.selectBizCustomerRechargeById(id);
    }
    /**
     * 查询用户充值
     *
     * @param orderNo
     * @return 用户充值
     */
    @Override
    public BizCustomerRecharge selectBizCustomerRechargeByOrderNo(String orderNo){
        return bizCustomerRechargeMapper.selectBizCustomerRechargeByOrderNo(orderNo);
    }
    /**
     * 查询用户充值列表
     * 
     * @param bizCustomerRecharge 用户充值
     * @return 用户充值
     */
    @Override
    public List<BizCustomerRecharge> selectBizCustomerRechargeList(BizCustomerRecharge bizCustomerRecharge) {
        return bizCustomerRechargeMapper.selectBizCustomerRechargeList(bizCustomerRecharge);
    }

    /**
     * 新增用户充值
     * 
     * @param bizCustomerRecharge 用户充值
     * @return 结果
     */
    @Override
    public int insertBizCustomerRecharge(BizCustomerRecharge bizCustomerRecharge) {
        bizCustomerRecharge.setCreateTime(DateUtils.getNowDate());
        return bizCustomerRechargeMapper.insertBizCustomerRecharge(bizCustomerRecharge);
    }
    /**
     * 修改用户充值
     * 
     * @param bizCustomerRecharge 用户充值
     * @return 结果
     */
    @Override
    public int updateBizCustomerRecharge(BizCustomerRecharge bizCustomerRecharge) {
        bizCustomerRecharge.setUpdateTime(DateUtils.getNowDate());
        return bizCustomerRechargeMapper.updateBizCustomerRecharge(bizCustomerRecharge);
    }

    /**
     * 批量删除用户充值
     * 
     * @param ids 需要删除的用户充值主键
     * @return 结果
     */
    @Override
    public int deleteBizCustomerRechargeByIds(String ids) {
        return bizCustomerRechargeMapper.deleteBizCustomerRechargeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户充值信息
     * 
     * @param id 用户充值主键
     * @return 结果
     */
    @Override
    public int deleteBizCustomerRechargeById(Long id) {
        return bizCustomerRechargeMapper.deleteBizCustomerRechargeById(id);
    }
}
